<?php
/**
 * Created by JetBrains PhpStorm.
 * User: sergey.uchvatov
 * Date: 06.02.13
 * Time: 15:28
 * To change this template use File | Settings | File Templates.
 */
?>
<?php if(!empty($columns)) : ?>

<div class="row">
  <?php foreach($columns as $column) : ?>

  <div class="span<?php print 12 / count($columns);//todo: wtf? ?>">
    <?php foreach($column as $section) : ?>

    <?php if(sizeof($section['items']) > 0) : ?>
      <div class="section-title"><?php print $section['title']; ?></div>

      <ul>
        <?php foreach($section['items'] as $item) : ?>
        <?php $field = field_get_items('taxonomy_term', $item, 'field_private_ad_section_alias'); ?>
        <?php $alias = isset($field[0]) ? $field[0]['value'] : 'undefined'; ?>
        <li><?php print l($item->name, PRIVATE_AD_BASE_PATH_ALIAS . '/' . $alias); ?></li>
        <?php endforeach; ?>
      </ul>

      <?php endif; ?>
    <?php endforeach; ?>
  </div>

  <?php endforeach; ?>
</div>

<?php endif; ?>